home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93a.txt / 000117_icon-group-sender _Sun Apr 4 21:20:33 1993.msg < prev    next >
Internet Message Format  |  1993-04-21  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 12 Apr 1993 11:01:54 MST
  2. Date: 4 Apr 93 21:20:33 GMT
  3. From: pipex!marble.uknet.ac.uk!mcsun!news.funet.fi!uta!jere@uunet.uu.net  (Jere K{pyaho)
  4. Organization: University of Tampere, Finland
  5. Subject: Re: Icon rookie problems solved
  6. Message-Id: <9394@kielo.uta.fi>
  7. References: <9364@kielo.uta.fi>, <1993Apr2.150623.19869@midway.uchicago.edu>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. In article <1993Apr2.150623.19869@midway.uchicago.edu> goer@midway.uchicago.edu writes:
  14.  
  15. >The key to scanning is that scanning handles all of your place-
  16. >keeping for you, so you don't have to use "every" or the like.
  17. >When I tab( upto(c) ), then the first result produced by upto(c)
  18. >is where I tab to, and that becomes my position (my &pos, in Icon's
  19. >terms).  If I want the next c, I can just move(1) past the current
  20. >c, and then do another tab( upto(c) ).  Icon knows where I am in
  21. >the string, and I don't have to keep track of it myself.  The next
  22. >time I tab( upto(c) ) I'll end up at the next match!
  23.  
  24. This is a very lucid explanation of scanning. I wasn't quite sure
  25. about what was going on, but now I think I'm a little more educated
  26. in this respect. Thanks.
  27.  
  28. >    every i := upto(c)
  29.  
  30. I wanted to use an intermediate variable so as to make things
  31. clearer (i.e., not to write a thoroughly compact -- and possibly
  32. obscure -- expression.)
  33.  
  34. As Beth Weiss pointed out, we are not really *generating* here.
  35. I congratulate myself for coming up with another solution that
  36. uses suspend not long after I posted my initial solution. 
  37.  
  38. It seems that there are quite many ways of achieving things
  39. in Icon. The language caters for a wide spectrum of programming
  40. styles, which is good. Many idioms of Icon initially seem very
  41. obscure to the uninitiated. Of course, they start to make sense
  42. fairly quickly. Then again, you can write incomprehensible code
  43. in any programming language, including Icon. But I'll happily
  44. choose Icon over C for any task concerned with string processing
  45. and even primitive database work (Icon is probably suitable
  46. for much more sophisticated database programming, but I'm only
  47. familiar with the primitive variant :-)
  48. -- 
  49. // Jere K{pyaho (jere@kielo.uta.fi)   |   Work is the curse of the
  50. // University of Tampere, Finland     |   drinking classes. -Oscar Wilde
  51.